<!DOCTYPE html>
<html><head><title>flashls/Chromeless Player sample page</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
</head>
<body style="color: Black; background-color: White;" link="Blue" vlink="Purple">
<big style="font-weight: bold;"><big><code> flashls/Chromeless sample page </code></big></big><br>

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
 codebase="" id="mymoviename" width="640" height="360">
<param name="movie"  value="../../bin/release/flashlsChromeless.swf" />
<param name="quality" value="high" />
<param name="swliveconnect" value="true" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="bgcolor" value="#0" />
<param name="allowFullScreen" value="true" />

<embed src="../../bin/release/flashlsChromeless.swf" width="640" height="360" name="mymoviename"
            quality="high"
            bgcolor="#0"
            align="middle" allowFullScreen="true"
            allowScriptAccess="sameDomain"
            type="application/x-shockwave-flash"
            swliveconnect="true"
            pluginspage="http://www.macromedia.com/go/getflashplayer" >
</embed>
</object>


<script type="text/javascript">

function onHLSReady(message) {
    document.getElementById("videoStatus").innerHTML += "onHLSReady()<br />";
    load("http://www.streambox.fr/playlists/test_001/stream.m3u8");
}


function load(url) {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.load(url);
    document.getElementById("videoStatus").innerHTML += "start playback for " + url + "<br />";
  }
}

function play() {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.play();
    document.getElementById("videoStatus").innerHTML += "start playback<br />";
  }
}

function pause() {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.pause();
    document.getElementById("videoStatus").innerHTML += "pause playback<br />";
  }
}

function resume() {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.resume();
    document.getElementById("videoStatus").innerHTML += "resume playback<br />";
  }
}

function stop() {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.stop();
    document.getElementById("videoStatus").innerHTML += "stopping playback<br />";
  }
}

function setlevel(level) {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.setLevel(level);
    document.getElementById("videoStatus").innerHTML += "force level to :" + level + "<br />";
  }
}

function seek(position) {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.seek(position);
    document.getElementById("videoStatus").innerHTML += "seek to :"+ position + "<br />";
  }
}

function volume(percent) {
  var obj = getFlashMovieObject("mymoviename");
  if(obj != null) {
    obj.volume(percent);
    document.getElementById("videoStatus").innerHTML += "set volume to :"+ percent + "%<br />";
  }
}

function onComplete(message) {
  document.getElementById("videoStatus").innerHTML += "onComplete(), playback completed<br />";
}
function onError(message) {
  document.getElementById("videoStatus").innerHTML += "onError():"+ message + "<br />";
}

function onFragment(bandwidth,level,width) {
  document.getElementById("videoStatus").innerHTML += "onFragment(): bandwidth:" + bandwidth + " level:" + level + " width:" + width + "<br />";
}

function onManifest(message) {
  document.getElementById("videoStatus").innerHTML += "manifest loaded<br />";
  play();
}

function onPosition(position,duration) {
  document.forms['mediaTime'].mediaPosition.value = position;
  document.forms['mediaTime'].mediaDuration.value = duration;
}
function onState(message) {
  document.getElementById("videoStatus").innerHTML += "switching state to "+ message + "<br />";
}
function onSwitch(message) {
  document.getElementById("videoStatus").innerHTML += "switching level to "+ message + "<br />";
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName])
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName];
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}
</script>
<form name="mediaTime">
    media position <br />
    <textarea name="mediaPosition" rows="1"></textarea>
  <textarea name="mediaDuration" rows="1"></textarea>
</form>
<div id="media_control">
<div id="Play" class="box">Play</div>
<div id="Pause" class="box" onclick=pause()>Pause</div>
<div id="Resume" class="box" onclick=resume()>Resume</div>
<div id="Stop" class="box" onclick=stop()>Stop</div>
<div id="Seek" class=box" onclick=seek(document.forms['seekPos'].seekPosition.value)>Seek</div>
<div id="Volume" class=box" onclick=volume(document.forms['volLevel'].volumeLevel.value)>Volume</div>
<div id="Level" class=box" onclick=setlevel(document.forms['QualityLevel'].QualityLevel.value)>Level</div>
</div>

<form name="seekPos"> seek to   <textarea name="seekPosition" rows="1">0</textarea> </form>
<form name="volLevel"> set volume level to  <textarea name="volumeLevel" rows="1">100</textarea> </form>
<form name="QualityLevel"> force quality level to   <textarea name="QualityLevel" rows="1">-1</textarea> </form>
<div id="videoStatus">Video status messages<br /></div>
</div>
</body></html>